home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Freeware / Gobby 0.4.7 / gobby-0.4.7.exe / {app} / share / gtksourceview-2.0 / language-specs / html.lang < prev    next >
Extensible Markup Language  |  2008-09-09  |  6KB  |  161 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Authors: Marco Barisione, Emanuele Aina
  5.  Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com>
  6.  Copyright (C) 2005-2007 Emanuele Aina
  7.  
  8.  This library is free software; you can redistribute it and/or
  9.  modify it under the terms of the GNU Library General Public
  10.  License as published by the Free Software Foundation; either
  11.  version 2 of the License, or (at your option) any later version.
  12.  
  13.  This library is distributed in the hope that it will be useful,
  14.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  Library General Public License for more details.
  17.  
  18.  You should have received a copy of the GNU Library General Public
  19.  License along with this library; if not, write to the
  20.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21.  Boston, MA 02111-1307, USA.
  22.  
  23. -->
  24. <language id="html" _name="HTML" version="2.0" _section="Markup">
  25.     <metadata>
  26.       <property name="mimetypes">text/html</property>
  27.       <property name="globs">*.html;*.htm</property>
  28.       <property name="block-comment-start"><!--</property>
  29.       <property name="block-comment-end">--></property>
  30.     </metadata>
  31.  
  32.     <styles>
  33.         <style id="comment" _name="Comment" map-to="xml:comment"/>
  34.         <style id="tag" _name="Tag" map-to="xml:element-name"/>
  35.         <style id="attrib-name" _name="Attribute Name" map-to="xml:attribute-name"/>
  36.         <style id="attrib-value" _name="Attribute Value" map-to="xml:attribute-value"/>
  37.         <style id="dtd" _name="DTD" map-to="xml:doctype"/>
  38.         <style id="error" _name="Error" map-to="xml:error"/>
  39.     </styles>
  40.  
  41.     <default-regex-options case-sensitive="false"/>
  42.  
  43.     <definitions>
  44.         <!-- Html comments are more permissive than xml comments -->
  45.         <context id="comment" style-ref="comment">
  46.             <start><!--</start>
  47.             <end>--\s*></end>
  48.             <include>
  49.                 <context ref="def:in-comment"/>
  50.             </include>
  51.         </context>
  52.  
  53.         <context id="dtd" style-ref="dtd">
  54.             <start><!</start>
  55.             <end>></end>
  56.         </context>
  57.  
  58.         <!-- This is a placeholder context intended to be <replace>d
  59.              in languages like php that need to embedd contexts inside
  60.              html tags and attributes.
  61.         -->
  62.         <context id="embedded-lang-hook">
  63.             <start>\%{def:never-match}</start>
  64.             <end></end>
  65.         </context>
  66.  
  67.         <context id="generic-tag">
  68.             <include>
  69.  
  70.                 <!-- Attribute in the form: name="value" -->
  71.                 <context id="attrib-quoted" style-ref="attrib-name">
  72.                     <start extended="true">
  73.                         [A-Za-z0-9:_-]+ # attribute name
  74.                         \s*=\s*         # "="
  75.                         (\")            # string beginning
  76.                     </start>
  77.                     <end>\"</end>
  78.                     <include>
  79.                         <context sub-pattern="1" where="start" style-ref="attrib-value"/>
  80.                         <context sub-pattern="0" where="end" style-ref="attrib-value"/>
  81.                         <context id="string" extend-parent="false" end-at-line-end="true" style-ref="attrib-value">
  82.                             <start>\%{def:always-match}</start>
  83.                             <include>
  84.                                 <context ref="xml:entity"/>
  85.                                 <context ref="xml:character-reference"/>
  86.                                 <context ref="embedded-lang-hook"/>
  87.                             </include>
  88.                         </context>
  89.                     </include>
  90.                 </context>
  91.  
  92.                 <!-- Attribute in the form: name=value -->
  93.                 <context id="attrib-unquoted" style-ref="attrib-value">
  94.                     <start extended="true">
  95.                         [a-z0-9:_-]+ # attribute name
  96.                         \s*=\s*      # "="
  97.                     </start>
  98.                     <end>(?=>|\s)</end>
  99.                     <include>
  100.                         <context sub-pattern="0" where="start" style-ref="attrib-name"/>
  101.                         <context ref="xml:entity"/>
  102.                         <context ref="xml:character-reference"/>
  103.                     </include>
  104.                 </context>
  105.  
  106.                 <!-- Attribute in the form: name -->
  107.                 <context id="attrib-no-value" style-ref="attrib-name">
  108.                     <match extended="true">
  109.                         [a-z0-9:_-]+  # attribute name
  110.                     </match>
  111.                 </context>
  112.  
  113.                 <context ref="embedded-lang-hook"/>
  114.  
  115.             </include>
  116.         </context>
  117.  
  118.         <context id="script">
  119.             <start><\s*script\%]</start>
  120.             <end><\s*/\s*script\s*></end>
  121.  
  122.             <include>
  123.                 <context sub-pattern="0" where="start" style-ref="tag"/>
  124.                 <context sub-pattern="0" where="end" style-ref="tag"/>
  125.                 <context ref="generic-tag"/>
  126.                 <context id="js-code" extend-parent="false">
  127.                     <start>></start>
  128.                     <include>
  129.                         <context sub-pattern="0" where="start" style-ref="tag"/>
  130.                         <context ref="js:js"/>
  131.                     </include>
  132.                 </context>
  133.             </include>
  134.         </context>
  135.  
  136.         <context id="tag">
  137.             <start><\s*/?\s*[a-z0-9_-]+</start>
  138.             <end>/?\s*></end>
  139.             <include>
  140.                 <context sub-pattern="0" where="start" style-ref="tag"/>
  141.                 <context sub-pattern="0" where="end" style-ref="tag"/>
  142.                 <context ref="generic-tag"/>
  143.             </include>
  144.         </context>
  145.  
  146.         <context id="html">
  147.             <include>
  148.                 <context ref="xml:doctype"/>
  149.                 <context ref="xml:entity"/>
  150.                 <context ref="xml:character-reference"/>
  151.                 <context ref="xml:cdata"/>
  152.                 <context ref="comment"/>
  153.                 <context ref="dtd"/>
  154.                 <context ref="script"/>
  155.                 <context ref="tag"/>
  156.             </include>
  157.         </context>
  158.  
  159.     </definitions>
  160. </language>
  161.